Imaging apparatuses such as digital cameras or digital video cameras generally employ CCD sensors or CMOS sensors as image sensors in which color filters are arranged. With such image sensors, there are cases where a defective pixel (also called a “flicker defect”) occurs due to structural factors, factors occurring during the process of manufacture, external factors occurring after manufacture, and so on. For example, one example of the factors that produce defective pixels in a CMOS sensor is noise occurring in a floating diffusion where charges are received from photodiodes. Such noise does not always occur periodically, so sometimes noise may occur at frequent intervals such as every few times imaging is performed, and sometimes noise may occur at infrequent intervals such as every few years. It is also known that the frequency of occurrence of defective pixels in an image sensor does not depend on the temperature and the charge accumulation time.
In view of this, techniques for detecting a defective pixel in an image sensor have been proposed in Japanese Patent Laid-Open Nos. 2004-297267 and 2001-086517. With these techniques, it is possible to detect not only a defective pixel occurring at a specific position during the process of manufacture, but also a defective pixel occurring after manufacture. For example, Japanese Patent Laid-Open No. 2004-297267 discloses a technique for obtaining, for each color filter, a difference in signal level between a pixel of interest and a plurality of neighboring pixels of the pixel of interest, and, if all of the differences are greater than or equal to a threshold, detecting the pixel of interest as a defective pixel. Japanese Patent Laid-Open No. 2001-086517 discloses a technique for obtaining luminance values of all the pixels regardless of the color of color filters, and if a difference in luminance level between a pixel of interest and a plurality of neighboring pixels is greater than or equal to a threshold, detecting the pixel of interest as a defective pixel.
However, with the conventional techniques, a defective pixel occurring in an image sensor cannot be detected with high precision. For example, with the technique disclosed in Japanese Patent Laid-Open No. 2004-297267, in the case where highly sensitive imaging is performed, the amplification factor of image data (image signal) is increased and accordingly a noise component included in the image data is amplified as well, so in some cases the noise component may be more prominent than the signal levels of the neighboring pixels of the pixel of interest. In particular, there is a higher possibility, in a region where the spatial frequency of an object is low, that such a noise component will have a greater value than the signal levels of the neighboring pixels of the pixel of interest, and as a result, the difference in signal level between the pixel of interest and the neighboring pixels becomes greater than a threshold, and the pixel of interest may be mis-detected as a defective pixel. Note that, although it is conceivable that the threshold is set to a high value in order to avoid such mis-detection, it is difficult in a region where the signal level is high to detect a defective pixel because the difference in signal level between the pixel of interest and the neighboring pixels is small (less apparent). Similar problems to Japanese Patent Laid-Open No. 2004-297267 also arise with the technique disclosed in Japanese Patent Laid-Open No. 2001-086517.